package com.xiaodu.acer.phoneplay.data;

import com.xiaodu.acer.phoneplay.bean.PageBean;
import com.xiaodu.acer.phoneplay.bean.Subject;
import com.xiaodu.acer.phoneplay.bean.SubjectDetail;
import com.xiaodu.acer.phoneplay.data.http.ApiService;
import com.xiaodu.acer.phoneplay.presenter.contract.SubjectContract;

import io.reactivex.Observable;
import library.base.BaseBean;

/**
 * @author 小杜 QQ:1392229149
 * @name ShouJiZhuShou
 * @class name：com.xiaodu.acer.phoneplay.data
 * @class describe
 * @time 2018/1/14 0:30
 * @change
 * @chang time
 * @class describe
 */
public class SubjectModel implements SubjectContract.Model {

    private ApiService mApiService;

    public SubjectModel(ApiService service) {
        this.mApiService = service;
    }


    @Override
    public Observable<BaseBean<PageBean<Subject>>> getSubjects(int page) {
        return mApiService.subjects( page );
    }

    @Override
    public Observable<BaseBean<SubjectDetail>> getSubjectDetail(int id) {
        return mApiService.subjectDetail( id );
    }
}
